package com.linkgie.galaxyframework.kvstorage.spi;

import com.linkgie.galaxyframework.kvstorage.DataCodecException;

/**
 * 基本类型数据编解码器；
 * 
 * @author spring
 *
 */
public interface PrimitiveDataCodec {

	byte[] encodeBoolean(boolean value) throws DataCodecException;

	byte[] encodeByte(byte value) throws DataCodecException;

	byte[] encodeChar(char value) throws DataCodecException;

	byte[] encodeShort(short value) throws DataCodecException;

	byte[] encodeInt(int value) throws DataCodecException;

	byte[] encodeLong(long value) throws DataCodecException;

	byte[] encodeFloat(float value) throws DataCodecException;

	byte[] encodeDouble(double value) throws DataCodecException;

//	byte[] encodeString(String value) throws DataCodecException;

	boolean decodeBoolean(byte[] value) throws DataCodecException;

	byte decodeByte(byte[] value) throws DataCodecException;

	char decodeChar(byte[] value) throws DataCodecException;

	short decodeShort(byte[] value) throws DataCodecException;

	int decodeInt(byte[] value) throws DataCodecException;

	long decodeLong(byte[] value) throws DataCodecException;

	float decodeFloat(byte[] value) throws DataCodecException;

	double decodeDouble(byte[] value) throws DataCodecException;

}
